/*
 *  main.cc
 *  MathParser
 *
 *  Created by Johan Astborg on 13/8/11.
 *  Copyright 2011 Johan Astborg. All rights reserved.
 *
 */

#include "lexer.h"

#include <iostream>

using namespace std;

int main() {

	Lexer l(cin);
	Token *t;
	do {
		t = l.scan();
		if (t->tag == TS_REAL)
			cout << "REAL: " << ((Real*)t)->value << endl;
		if (t->tag == TS_NUM)
			cout << "NUM: " << ((Num*)t)->value << endl;
		if (t->tag == TS_ADD)
			cout << "ADD" << endl;
		if (t->tag == TS_SUB)
			cout << "SUB" << endl;
		if (t->tag == TS_MUL)
			cout << "MUL" << endl;
		if (t->tag == TS_DIV)
			cout << "DIV" << endl;
		if (t->tag == TS_LPAR)
			cout << "LPAR" << endl;
		if (t->tag == TS_RPAR)
			cout << "RPAR" << endl;
	} while (t->tag != TS_EOF);
	
	return 0;
}
